import request from '@/utils/request'

/**
 * 获取角色列表
 * @returns
 */
export const getRoleListAPI = () => {
  return request({
    url: '/roleList',
    method: 'GET'
  })
}

export const addRoleAPI = (data) => {
  return request({
    url: '/role',
    method: 'POST',
    data
  })
}

export const getRoleAPI = (id) => {
  return request({
    url: `/role/${id}`,
    method: 'GET'
  })
}

export const putRoleAPI = (id, data) => {
  return request({
    url: `/role/${id}`,
    method: 'PUT',
    data
  })
}
